package com.zx.feign;

import com.zx.feign.fallback.ProductFeignClientCallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 商品微服务的远程调用
 *
 * @author jack.wu
 */
@FeignClient(value = "service-product", fallback = ProductFeignClientCallBack.class)
public interface ProductFeignClient {

    /**
     * 商品微服务查询商品
     * @param id 商品id
     * @return 商品信息
     */
    @GetMapping("/product/{id}")
    String findById(@PathVariable("id") Long id);

}
